function comp () {
 if [[ $1 == '--help' || $1 == '-h' ]]
  then echo -e '\nThis guided tool will assist in compressing files.\n'
  return
 fi 

 if [[ $1 == '--short' || $1 == '-s' ]]
  then ls
  read -ep 'Shorthand usage: file.ext files ' comp_shortver
  local FILE=`echo $comp_shortver | sed 's/\ .*//g'`

  if [ -f $FILE ] 
   then echo $FILE' already exists. Please try again with a different filename'
   return
  fi
  
  local COMPFILES=`echo $comp_shortver | sed 's/'$FILE'\ //'`
  case $FILE in
    *.tar.bz2) shift && tar cjf $FILE $COMPFILES ;;
    *.tar.gz) shift && tar czf $FILE $COMPFILES ;;
    *.tgz) shift && tar czf $FILE $COMPFILES ;;
    *.zip) shift && zip $FILE $COMPFILES ;;
    *) echo $FILE' has an invalid archive type'
  esac

  if [ -f $FILE ] 
   then echo -e '\nFiles have successfully been compressed into '$FILE' located in '`pwd` | egrep --color=auto $FILE
   ls -lh | grep $FILE
  fi
  return
 fi 

 clear
 echo 'Possible compression methods.'
 echo 'tar.bz2'
 echo 'tar.gz'
 echo 'tgz'
 echo -e 'zip\n'
 read -p 'Compression method: ' var_compmethod

 if [ `echo $var_compmethod | cut -c1` == '.' ]
  then var_compmethod=`echo $var_compmethod | cut -c 2-`
 fi

 if [[ $var_compmethod != 'tar.bz2' && $var_compmethod != 'tar.gz' && $var_compmethod != 'tgz' && $var_compmethod != 'zip' ]] 
  then echo $var_compmethod' is not a valid archive type'
  return
 fi

 read -ep 'File name: ' var_filename
 if [ -f $var_filename'.'$var_compmethod ]
  then echo 'File '$var_filename'.'$var_compmethod' already exists'
  return
 fi

 echo
 ls
 echo
 read -ep 'Files to compress: ' var_compfiles
 echo
 
 if [ $var_compmethod == 'tar.bz2' ] 
  then echo 'Compressing please wait...' ; tar cjf $var_filename'.'$var_compmethod $var_compfiles
 elif [ $var_compmethod == 'tar.gz' ]
  then echo 'Compressing please wait...' ; tar czf $var_filename'.'$var_compmethod $var_compfiles
 elif [ $var_compmethod == 'tgz' ]
  then echo 'Compressing please wait...' ; tar czf $var_filename'.'$var_compmethod $var_compfiles
 elif [ $var_compmethod == 'zip' ]
  then echo 'Compressing please wait...' ; zip $var_filename'.'$var_compmethod $var_compfiles
 fi

 if [ -f $var_filename'.'$var_compmethod ] 
  then echo -e '\nFiles have successfully been compressed into '$var_filename'.'$var_compmethod' located in '`pwd` | egrep --color=auto $var_filename'.'$var_compmethod
  ls -lh | grep $var_filename'.'$var_compmethod
 fi
}